<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
	<head>
		 <base href="<%=basePath%>">
		<link rel="stylesheet" href="css/bootstrap.min.css">
		<link href="css/content.css" rel="stylesheet">
		<link  href="css/footer.css" rel="stylesheet">
		<script type="text/javascript" src="js/jquery-3.4.1.js"></script>
		<script type="text/javascript" src="js/bootstrap.min.js"></script>
			<script type="text/javascript" src="js/validate.js"></script>
		<meta charset="utf-8">
		<title>注册页面</title>
	</head>
	<body>
			<!-- 导入导航栏 -->
		<jsp:include page="/common/header.jsp"></jsp:include>
			<!-- 分割 -->
		<div style="height: 20px;"></div>
		<!--内容-->
		<div class="big_czmm_content">
			<div class="denglu_content">
				<div class="biaoti">
					<a class="zhong">个人注册</a>
					<a>企业注册</a>
				</div>
				<!--个人注册-->
				<div class="nr_box clearfix">
					<div class="nr clearfix">
						<div class="nr_left">
							<form action="person/register" method="post" enctype="multipart/form-data" onsubmit="return check()">
								<div class="nr_01">
									<div class="text">用户头像</div>
								</div>
								<div style="position: relative;border: 5px solid lightblue;width: 100px;height:120px;margin: 5px auto;">
									<img src="img/default.jpg" alt="选择并上传头像" id="avatar_img" style="width: 90px;height: 110px;left:0;top: 0;" />
									<input type="file" id="avatar_file" name="file" accept="image/jpg,image/png,image/gif" style="width: 100%;height:100%;opacity: 0;position: absolute;left:0;top: 0;" />
								</div>
								<div class="nr_01">
									<div class="text">用户名</div>
									<input type="text" name="username"  class="input_00  " placeholder="邮箱/手机号" onblur="userdate(this.value)" />
								</div>
								<div class="tishi">
									<span id="erroruser"></span>
								</div>
								<div class="nr_01">
									<div class="text">密码</div>
									<input type="password"  name="password" class="input_00"  placeholder="密码"   onblur="psdate(this.value)"/>
								</div>
									<div class="tishi">
									<span id="errorps"></span>
								</div>
								<div class="nr_01">
									<div class="text">确认密码</div>
									<input type="password"  name="password2" class="input_00"  placeholder="确认密码"  onblur="ps2date(this.value)"/>
								</div>
								<div class="tishi">
									<span id="errorps2"></span>
								</div>
								<div class="nr_01">
									<div class="text">姓名</div>
									<input type="text" name="name" class="input_00" placeholder="姓名" onblur="namedate(this.value)"/>
								</div>
								<div class="tishi">
									<span id="errorname"></span>
								</div>
								<div class="nr_01">
									<div class="text">性别</div>
									<input style="margin-top: 12px;" type="radio" name="sex" value="0" checked="checked"> 男
									<input type="radio" name="sex" value="1"> 女
								</div>

								<div class="nr_01">
									<div class="text">出生日期</div>
									<input type="date" name="birthday" class="input_00"  onblur="birthdate(this.value)"/>
								</div>
								<div class="tishi">
									<span id="errorbirth"></span>
								</div>

								<div class="nr_01">
									<div class="text">学校</div>
									<input type="text" name="school" class="input_00" placeholder="学校" onblur="schooldate(this.value)"/>
								</div>
								<div class="tishi">
									<span id="errorschool"></span>
								</div>
								
								<div class="nr_01">
									<div class="text">专业</div>
									<input type="text" name="pro" class="input_00" placeholder="专业" onblur="prodate(this.value)"/>
								</div>
								<div class="tishi">
									<span id="errorpro"></span>
								</div>
								
								<div class="nr_01">
									<div class="text">学历</div>
									<select name="degree" class="input_00 form-control" onblur="degreedate(this.value)">
										<option selected>请选择</option>
										<option>高中及以下</option>
										<option>大专</option>
										<option>本科</option>
										<option>硕士</option>
										<option>博士</option>
									</select>
								</div>
								<div class="tishi">
									<span id="errordegree"></span>
								</div>
								
								<div class="nr_01">
									<div class="text">联系方式</div>
									<input type="text" name="phone" class="input_00" placeholder="联系方式"  onblur="phonedate(this.value)" />
								</div>
								<div class="tishi">
									<span id="errorphone"></span>
								</div>

								<div class="nr_01">
									<div class="text">电子邮箱</div>
									<input type="text" name="email" class="input_00" placeholder="电子邮箱"  onblur="emaildate(this.value)" />
								</div>
								<div class="tishi">
									<span id="erroremail"></span>
								</div>
								<div class="nr_01">
									<div class="text">薪资要求</div>
									<select name="salary" class="input_00 form-control" onblur="salarydate(this.value)" >
										<option selected>请选择</option>
										<option>3k以下</option>
										<option>3k-4k</option>
										<option>3k-4k</option>
										<option>4k-5k</option>
										<option>5k-6k</option>
										<option>7k-8k</option>
										<option>8k以上</option>
									</select>
								</div>
								<div class="tishi">
									<span id="errorsalary"></span>
								</div>
								
								
								<div class="nr_01">
									<div class="text">到岗时间</div>
									<input name="worktime" type="date" class="input_00" onblur="timedate(this.value)"/>
								</div>
								<div class="tishi">
									<span id="errortime"></span>
								</div>
								
								
								
								<div class="nr_01">
									<div class="text">工作经验</div>
									<textarea name="exp" class="input_001" value="无">
								</textarea>
								</div>
								<div class="tishi">
									<span id="errorexp"></span>
								</div>

								<div class="nr_01">
									<div class="text">个人评价</div>
									<textarea name="tips" class="input_001" value="无">
								</textarea>
								</div>
								<div class="tishi">
									<span id="errortips"></span>
								</div>
								
								<input type="hidden" value="0" name="status">
								<div class="nr_02">
									<input type="submit" value="立即注册" class="input_11">
								</div>
							</form>
						</div>
						<div class="nr_right">
							<div class="nr_03">
								<span>已有个人账号？</span>
								<a href="login.jsp">立即登录</a>
							</div>
						</div>
					</div>


					<!--企业注册-->
					<div class="nr dis_no clearfix">
						<div class="nr_left">
							<form action="company/register" method="post"  enctype="multipart/form-data" onsubmit="return check1()"  >
								<div class="nr_01">
									<div class="text">企业图片</div>
								</div>
								<div style="position: relative;border: 5px solid lightblue;width: 100px;height:120px;margin: 5px auto;">
									<img src="img/default.jpg" alt="选择并上传头像" id="avatar_img1" style="width: 90px;height: 110px;left:0;top: 0;" />
									<input type="file" id="avatar_file1" name="file" accept="image/jpg,image/png,image/gif" style="width: 100%;height:100%;opacity: 0;position: absolute;left:0;top: 0;" />
								</div>
								<div class="nr_01">
									<div class="text">用户名</div>
									<input type="text" name="username"  class="input_00  " placeholder="邮箱/手机号" onblur="cuserdate(this.value)" />
								</div>
								<div class="tishi">
									<span id="cerroruser"></span>
								</div>
								<div class="nr_01">
									<div class="text">密码</div>
									<input type="password"  name="password" class="input_00"  placeholder="密码"   onblur="cpsdate(this.value)"/>
								</div>
									<div class="tishi">
									<span id="cerrorps"></span>
								</div>
								<div class="nr_01">
									<div class="text">确认密码</div>
									<input type="password"  name="password2" class="input_00"  placeholder="确认密码"  onblur="cps2date(this.value)"/>
								</div>
								<div class="tishi">
									<span id="cerrorps2"></span>
								</div>
								<div class="nr_01">
									<div class="text">公司名称</div>
									<input type="text" name="name" class="input_00" placeholder="姓名" onblur="cnamedate(this.value)"/>
								</div>
								<div class="tishi">
									<span id="cerrorname"></span>
								</div>


								<div class="nr_01">
									<div class="text">公司宣传标题</div>
									<input type="text" name="title" class="input_00" placeholder="公司宣传标题" onblur="titledate(this.value)" />
								</div>
								<div class="tishi">
									<span id="errortitle"></span>
								</div>
								

								<div class="nr_01">
									<div class="text">公司类型</div>
									<select class="input_00 form-control" name="comtype" onblur="companydate(this.value)" >
										<option selected>请选择</option>
										<option>私企</option>
										<option>国企</option>
										<option>上市公司</option>
									</select>
								</div>
								<div class="tishi">
									<span id="errorcom"></span>
								</div>
								<div class="nr_01">
									<div class="text">公司规模</div>
									<select name="sum" class="input_00 form-control" onblur="guimodate(this.value)">
										<option selected>请选择</option>
										<option>少于15人</option>
										<option>15-50人</option>
										<option>50-150人</option>
										<option>150-500人</option>
										<option>500-2000人</option>
										<option>2000人以上</option>
									</select>
								</div>
								<div class="tishi">
									<span id="errorguimo"></span>
								</div>
				
								<div class="nr_01">
									<div class="text">公司地址</div>
									<input name="location" type="text" class="input_00" placeholder="公司地址"  onblur="addressdate(this.value)"/>
								</div>
								<div class="tishi">
									<span id="errorad"></span>
								</div>
								
									<div class="nr_01">
									<div class="text">联系方式</div>
									<input type="text" name="phone" class="input_00" placeholder="联系方式"  onblur="cphonedate(this.value)" />
								</div>
								<div class="tishi">
									<span id="cerrorphone"></span>
								</div>

								<div class="nr_01">
									<div class="text">电子邮箱</div>
									<input type="text" name="email" class="input_00" placeholder="电子邮箱"  onblur="cemaildate(this.value)" />
								</div>
								<div class="tishi">
									<span id="cerroremail"></span>
								</div>
								<div class="nr_01">
									<div class="text">公司简介</div>
									<textarea name="tip" class="input_001" >
								</textarea>
								</div>
								<div class="tishi">
									<span id="errorjieshao"></span>
								</div>
								
								
								<input type="hidden" value="1" name="status">
								<div class="nr_02">
									<input type="submit" value="立即注册" class="input_11">
								</div>
								
								
							</form>
						</div>
						<div class="nr_right">
							<div class="nr_03">
								<span>已有公司账号？</span>
								<a href="login.jsp">立即登陆</a>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- 导入底部信息 -->
  	<jsp:include page="/common/footer.jsp"></jsp:include>
	
		<script type="text/javascript">
			$(function() {
				//选项卡and变色
				$(".denglu_content .biaoti a").click(function() {
					var index = $(this).index(".denglu_content .biaoti a");
					$(this).addClass("zhong").siblings().removeClass("zhong");
					$(".denglu_content .nr").eq(index).show().siblings().hide();
				});

				//input选中变色
				$(".denglu_content .nr_01 .input_00").focus(function() {
					$(".denglu_content .nr_01 .input_00").removeClass("input_lv");
					$(this).addClass("input_lv");
				});

			});
			//验证手机，显示手机验证码层
			function number(tt) {
				if (tt.match(/^1\d[0-9]{9}$/g)) {
					document.getElementById('error').innerText ="";
				} else {
						 document.getElementById('error').innerText ="请输入有效的邮箱地址/手机号";
				}
			};
			// 个人头像预览
			$("#avatar_file").change(function() {
				// 获取上传文件对象
				var file = $(this)[0].files[0];
				// 读取文件URL
				var reader = new FileReader();
				reader.readAsDataURL(file);
				// 阅读文件完成后触发的事件
				reader.onload = function() {
					// 读取的URL结果：this.result
					
					alert(this.result)
					$("#avatar_img").attr("src", this.result);
				}
			});
			// 公司头像预览
			$("#avatar_file1").change(function() {
				// 获取上传文件对象
				var file = $(this)[0].files[0];
				// 读取文件URL
				var reader = new FileReader();
				reader.readAsDataURL(file);
				// 阅读文件完成后触发的事件
				reader.onload = function() {
					// 读取的URL结果：this.result
					$("#avatar_img1").attr("src", this.result);
				}
			});
			
		</script>
	</body>
</html>
